import React, { Component } from 'react';
import autoBind from 'react-autobind';
import { connect } from 'dva';

import { getSearch } from '../utils/utils';

// widget 
import HeadNav from '../components/Common/HeadNav'
import PayResultBody from '../components/PayResult/PayResultBody'

class PayResultPage extends Component {
	constructor(props) {
        super(props)
        autoBind(this)
    }

	render() {
		const { location } = this.props
		let search = getSearch(location)

		return (
		  	<div>
                <HeadNav title={search.trade_status == 'TRADE_FINISHED' ? `订单支付成功`: `订单支付失败`}/>
    			<PayResultBody {...this.props} />
		    </div>
		);
	}
}

PayResultPage.propTypes = {
};

export default connect(({ meyley, order }) => ({
	meyley,
    order
}))(PayResultPage);